package ma.ac.onousc.gestionfi.EngagementPaiement.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class OrdrePaiement implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int idOP;
	private String numOP;
	@Temporal(TemporalType.TIMESTAMP)
	private Date dateOP;
	private String justifManuel;

	// bi-directional many-to-one association to Engagement
	@ManyToOne(fetch = FetchType.EAGER)
	private OrdrePaiementAnnulation ordrePaiementAnnulation;

	@ManyToOne(fetch = FetchType.EAGER)
	private Engagement engagement;

	@OneToMany(mappedBy = "ordrePaiement")
	private List<Justificatif> justificatif;

	@OneToMany(mappedBy = "ordrePaiement")
	private List<Cheque> cheque;

	@OneToMany(mappedBy = "ordrePaiement")
	private List<OrdreVirement> ordreVirement;



	public OrdrePaiement(String numOP, Date dateOP, String justifManuel) {
		super();
		this.numOP = numOP;
		this.dateOP = dateOP;
		this.justifManuel = justifManuel;
	}

	public OrdrePaiement() {
		super();
	}

	public int getIdOP() {
		return idOP;
	}

	public void setIdOP(int idOP) {
		this.idOP = idOP;
	}

	public String getNumOP() {
		return numOP;
	}

	public void setNumOP(String numOP) {
		this.numOP = numOP;
	}

	public Date getDateOP() {
		return dateOP;
	}

	public void setDateOP(Date dateOP) {
		this.dateOP = dateOP;
	}

	public String getJustifManuel() {
		return justifManuel;
	}

	public void setJustifManuel(String justifManuel) {
		this.justifManuel = justifManuel;
	}

	public OrdrePaiementAnnulation getOrdrePaiementAnnulation() {
		return ordrePaiementAnnulation;
	}

	public void setOrdrePaiementAnnulation(
			OrdrePaiementAnnulation ordrePaiementAnnulation) {
		this.ordrePaiementAnnulation = ordrePaiementAnnulation;
	}

	public Engagement getEngagement() {
		return engagement;
	}

	public void setEngagement(Engagement engagement) {
		this.engagement = engagement;
	}

	public List<Justificatif> getJustificatif() {
		return justificatif;
	}

	public void setJustificatif(List<Justificatif> justificatif) {
		this.justificatif = justificatif;
	}

	public List<Cheque> getCheque() {
		return cheque;
	}

	public void setCheque(List<Cheque> cheque) {
		this.cheque = cheque;
	}

	public List<OrdreVirement> getOrdreVirement() {
		return ordreVirement;
	}

	public void setOrdreVirement(List<OrdreVirement> ordreVirement) {
		this.ordreVirement = ordreVirement;
	}

}